package com.lanou3g.ptp.role_teacher.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.lanou.ptp.role_teacher.RoleTeacherService;
import com.lanou3g.ptp.entity.Role;
import com.lanou3g.ptp.entity.RoleTeacher;
import com.lanou3g.ptp.role_teacher.mapper.RoleTeacherMapper;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class RoleTeacherServiceImpl implements RoleTeacherService {
    @Autowired
    private RoleTeacherMapper roleTeacherMapper;
    @Override
    public void addRoleTeacher(RoleTeacher roleTeacher) {
        roleTeacherMapper.addRoleTeacher(roleTeacher);
    }

    @Override
    public void deleteById(Long id) {
        roleTeacherMapper.deleteById(id);
    }

    @Override
    public void deleteByIds(Integer[] ids) {
        roleTeacherMapper.deleteByIds(ids);
    }

    @Override
    public void updateById(RoleTeacher roleTeacher) {
        roleTeacherMapper.updateById(roleTeacher);
    }

    @Override
    public RoleTeacher findById(Long id) {
        RoleTeacher roleTeacher = roleTeacherMapper.findById(id);
        return roleTeacher;
    }

    @Override
    public List<RoleTeacher> findAll() {
       List<RoleTeacher> roleTeachers = roleTeacherMapper.findAll();
       return roleTeachers;
    }

    @Override
    public List<RoleTeacher> findByRoleId(Long roleId) {
        List<RoleTeacher> roleTeachers = roleTeacherMapper.findByRoleId(roleId);
        return roleTeachers;
    }
}
